<link rel="stylesheet" href="../Public/style/customization.css" />
<script type="text/javascript" src="__PUBLIC__/Js/jgsat.js"></script>

<style>
.wz_r2 {
    float: left;
  
    width: 60%;
    height: 28px;
    /*text-align: center;*/
    margin-top: 0px;
	}
#time_up, #time_mp {
    width: 25%;
    height: 21px;
    text-align: center;
    color: #A9A9A9;
    font-size: 12px;
	margin-top:5px;
    border: 1px solid #DDDDDD;	
}
option, input{font-family:微软雅黑}

.send{    width: 36%;
    background: #7a604b;
    color: #fff;
    height: 30px;
    line-height: 30px;
    text-align: center;
    margin-left: 3%;
	float:left}
</style>
<div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 <div class="title">提交需求</div>
			 <div class="search sprite_icon">
			     <span class="icon2 icon_com">
			 </div>
		 </div>
	 </div>
     <include file="Mobile:nav"/>
	 <div class="content P_color">
         {if $_GET['designid']}
             {php $user=M('User')->where('id='.$_GET['designid'])->find();}
             <div style="width:100%; color:#FFA800; text-align:center;font-size: 18px;">您正在预约 {$user['username']} 做设计</div>
         {/if}
      <form  id="myform2" method="post"  action="/index.php?g=Mobile&m=Guestbookadd&a=insert" onsubmit="return aaa()" > 
          <input name="modulename" value="Guestbook" type="hidden">
          <input  name="sjsid" id="sjs"  type="hidden" value="{$designid}"/>
          <input name="sjscharge" type="hidden" value="{$c['name']}"/>
          <input  name="mobileyzm" class="verify"  type="hidden" value=" "/>
		 <div class="form">
			 <div class="width">
				 <div class="text clear">
					 <span class="icon_com icon1"></span>
					<input placeholder="您的称呼" type="text" name="title" id="use"  >
			     </div>
			 </div>
			 <div class="width">
				 <div class="text clear">
					 <span class="icon_com icon2"></span>
					<input placeholder="您的电话" type="text" name="telephone" id="mobile"   >
			     </div>
			 </div>
             
                <div class="width clear">
				 <div class="text text1 left clear type">
					 <span class="icon_com icon2"></span>
					      <input placeholder="输入验证码" type="text" name="mobileyzm" id="telephone" class="wz_r2"  >   
				 </div>
				     <input type="button"  id="btn_mss" class="send" value="免费获取验证码" />
			     </div>
             
			 <div class="width clear">
				 <div class="text text1 left clear">
					 <span class="icon_com icon3"></span>
					 <select  class="wz_r2" name="bprovince" id="bprovince" onchange="area_change(this.value, 1,'bprovince','bcity','barea');" class="selt mr5" >
                       <option value="0">省份</option>
                     </select>                  
				 </div>
				 <div class="text text1 right clear">
					 <span class="icon_com icon3"></span>
					 <select class="wz_r2" name="bcity" onchange="area_change(this.value, 2,'bprovince','bcity','barea');" id="bcity" class="selt mr5" >
                         <option value="0">城市</option>
                       </select>
                       <script>area_change(0, 0,'bprovince','bcity','barea',0,0,0);</script>
				 </div>
			 </div>
			 <div class="width clear">
				 <div class="text text1 left clear type">
					 <span class="icon_com icon4"></span>
					 <select  class="wz_r2" id="itemType"  name="itemType" >
                      <option value="0">项目类型</option>

                        <YP:list name="Label" where="genre=17" order="listorder asc" id="r" limit="50">
                            <option value="{$r['title']}">{$r['title']}</option>
                        </YP:list>
                      </select>                    
				 </div>
				 <div class="text text1 right clear square">
					 <span class="icon_com icon5"></span>
					 
					  <select  class="wz_r2" id="budget"  name="itemArea" >
                      <option value="0">项目面积</option>
                            <YP:list name="Label" where="genre=18"  order="listorder asc" id="r" limit="50">
                                <option value="{$r['title']}">{$r['title']}</option>
                            </YP:list>
                      </select>    
				 </div>
			 </div>
			 <div class="width">
				 <div class="text clear">
					 <span class="icon_com icon6"></span>
					<select  class="wz_r2" id="budget"  name="budget" >
                      <option value="0">项目预算</option>
                            <YP:list name="Label" where="genre=19"  order="listorder asc" id="r" limit="50">
                                <option value="{$r['title']}">{$r['title']}</option>
                            </YP:list>
                      </select>        
				 </div>
			 </div>
			 <div class="width">
				 <div class="text text2 clear">
					 <span class="icon_com icon7"></span>
					 <p>方便联系时间：</p>
					 <select id="time_up" name="time_up" >
					  <option value="0">请选择</option>
					  <?php for($i=8;$i<=21;$i++){?>
					  <option value="<?php echo $i?>"><?php echo $i?>:00</option>
					  <?php }?>
					  </select> 
					  至
					 <select id="time_mp" name="time_mp" >
					  <option value="0">请选择</option>
					  </select> 
				 </div>
			 </div>
			 <div class="width">
				 <div class="text clear">
					 <span class="icon_com icon8"></span>
					 <input type="text" placeholder="备注(选填)" />
				 </div>
			 </div>

			
             <input type="submit" class="now" value="立即申请" />
		 </div>
      </form>   
	 </div>
	 <div class="pic">
			 <img src="../Public/images/pic1.jpg" alt="" />
	 </div>
	 <div class="pic2">
		 <img src="../Public/images/pic2.jpg" alt="" />
	 </div>

	 <div class="about">
		 <dl>
			 <dt><img src="../Public/images/pic3.jpg" alt="" /></dt>
			 <dd>
				 <h2>10万专业设计师</h2>
				 <p>10万个专业设计师上传的原创案例助您轻松找到满意的设计师</p>
			 </dd>
		 </dl>
		 <dl>
			 <dt><img src="../Public/images/pic4.jpg" alt="" /></dt>
			 <dd>
				 <h2>100%真实评价</h2>
				 <p>所有完成设计的业主都可对设计师进行评价</p>
			 </dd>
		 </dl>
		 <dl>
			 <dt><img src="../Public/images/pic5.jpg" alt="" /></dt>
			 <dd>
				 <h2>专属客服服务</h2>
				 <p>一对一客服服务，全程跟进解决设计装修疑惑</p>
			 </dd>
		 </dl>
	 </div>
 <style>
   .customization{ display:none}    
 </style>
<script type="text/javascript">
$('#time_up').change(function(){ 
	  var t=$("#time_up").val();  //时间
	  var l=22-t;
	  var i=1;
	  var html='';
	  
	  for(i=1;i<=l;i++){
		  var n=parseInt(t)+parseInt(i);
		  html+='<option value="'+n+'">'+ n +':00</option>';
		  }
		 $("#time_mp").html(html);   
	})

function aaa(){
	
	var phone_reg=/((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/;
       
        var use=$("#use").val();  //姓名
        var telephone=$("#mobile").val();  //电话
        var com=$("#itemArea").val();  //项目面积
        var info=$("#itemType").val(); //项目类型
        var budget=$("#budget").val();  //设计预算
        var address=$("#time_up").val();  //时间
		var sjsid=$("#sjs").val();  
		
		var city=$("#bcity").val(); 
        
		
       
        if(use=='' || use=='您的称呼')
        {
            alert("请填写您的姓名!");
            return false;
        }
        if(!phone_reg.test(telephone))
        {
            alert("您的手机号码不是正确的格式!");
            return false;
        } 
        if(info=='0')
        {
            alert("请选择项目类型!");
            return false;
        }
        if(com=='0')
        {
            alert("请选择项目面积");
            return false;
        }
		if(city==0)
        {
            alert("请选择城市!");
            return false;
        }
        if( budget=='0' )
        {
            alert("请选择项目预算!");
            return false;
        }
        
	


}

var wait=120;

$('#btn_mss').click(function(){
      var tel = $.trim($('#mobile').val());
       var partten = /^[1][34578][0-9]{9}$/;
	  // alert(tel);
	  if(partten.test(tel)){
		  
		  $.post('index.php?g=User&m=Sms&a=index', {'tel':tel},function(res){
              // alert(res);
			 if(res!=0){ 
			      alert('发送失败：'+res);
			  }else{
				    wait=120;
					 alert('发送成功');
			     time(document.getElementById("btn_mss"));
			   }
           });
		 }else{alert('手机号码格式不正确')}
	   
	    var mobile=document.getElementById("mobile").value;
		var partten = /^[1][34578][0-9]{9}$/;
		var fl=false;
		
		 
    });

$('#subbnt').click(function(){
	    var val=$("#yzm_t").val();  
        if(val=='')
        {
            alert("请输入验证码!");
            return false;
        }
		$('.verify').val(val);
		var id=$(this).attr('name');
		
		$("#"+id).submit();
	   
		
	})


  function time(o) {
	 
    if (wait == 0) {
      o.removeAttribute("disabled");
      o.value="免费获取验证码";
	  o.style.cursor=""; 
	  o.style.color="";
      wait = 120;
    } else {
      o.setAttribute("disabled", true);
      o.value="重新发送(" + wait + "S)";
	  o.style.cursor="default";
	  o.style.color="#999"; 
      wait--;
      setTimeout(function() {
                time(o)
              },
              1000)
    }
  }


	$('#time_up').change(function(){ 
	  var t=$("#time_up").val();  //时间
	  var l=22-t;
	  var i=1;
	  var html='';
	  
	  for(i=1;i<=l;i++){
		  var n=parseInt(t)+parseInt(i);
		  html+='<option value="'+n+'">'+ n +':00</option>';
		  }
		 $("#time_mp").html(html);   
	})
	



</script>

